import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 17655
 * Date: 2025-07-16
 * Time: 19:07
 */
public class test4 {
    public List<List<Integer>> generate(int numRows) {
        int n = numRows;
        Integer[][]dp = new Integer[n][];
        for(int i=0;i<n;i++){
            dp[i] = new Integer[i+1];
            dp[i][0] = dp[i][i] = 1;
            for(int j=1;j<i;j++){
                dp[i][j] = dp[i-1][j-1] + dp[i-1][j];
            }
        }

        List<List<Integer>> ret = new ArrayList<List<Integer>>();
        for(Integer[] row:dp){
            ret.add(Arrays.asList(row));
        }
        return ret;
    }
}
